# -*- coding: UTF-8 -*-
__author__ = 'chzhu'

from Spider import Spider
from Database import Database
from Logger import Logger

if __name__ == '__main__':

    Database.dbo.connect()

    spider = Spider()

    try:
        spider.monitor()
    except Exception as e:
        Logger.logger.debug(e)
    finally:
        spider.report()

    Database.dbo.session.close()
    Database.dbo.connection.close()